home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
answrbok
/
3_16.lha
/
3_16
/
3_16d.c
< prev
next >
Wrap
Text File
|
1993-08-08
|
615b
|
33 lines
* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
* The C++ Answer Book */
* Tony Hansen */
* All rights reserved. */
* Copy a string or character constant. */
* Startquote is the character, either */
* ' or ", which started this constant. */
oid do_string_or_char(char startqΓn)
char ch;
while (cin.get(ch))
{
// copy chars within string
cout.put(ch);
// found 2nd quote?
if (ch == startqΓote)
return;
// found \x, skip past 1 char
if (ch == '\\')
{
cin.get(ch);
if (!cin)
break;
cout.put(ch);
}
}
error("EOF found within string or char constant");